import sys
import os
import json


def settingUpPipy():
    path = r"_SettingUP/requirements.json"
    with open(path, mode="r") as f:
        res = f.read()
    dic = json.loads(res)
    sources = dic["sourcesAndPack"]
    installLibs = []
    for sor in sources:
        for lib in dic["sourcesAndPack"][sor]:
            os.system("pip3 install " + lib + " -i " + sor)
            installLibs.append(lib)
            print(" ")
            continue
    for lib in installLibs:
        os.system("pip3 install " + lib)
        print(" ")
        continue


settingUpPipy()
